package com.osi.service.impl;

import com.osi.bean.Admin;
import com.osi.mapper.AdminMapper;
import com.osi.service.AdminService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * @author lixin
 * @date 2021/2/8 16:13
 */
@Service
public class AdminServiceImpl extends ServiceImpl<AdminMapper, Admin> implements AdminService {


    @Override
    public Admin login(String username, String password) {
        Admin admin = baseMapper.selectOne(new QueryWrapper<Admin>()
                .eq("username", username)
                .eq("password", password)
                .eq("status", 1)
        );

        return admin;
    }



}
